The present invention relates to the simulation of a real-time system controlled by a microprocessor-driven controller, and, more particularly, to a method for synchronizing the simulation with the activity of the microprocessor.
Many electronic devices are run by microprocessors under software control. Examples of such devices include automatic control systems such as vehicular fuel injection systems, and computer embedded electronic devices generally. These devices are characterized by an intensive real-time exchange of electronic signals between the controller and its environment. In this context, the "environment" of the controller consists of peripheral components, some of which produce signals indicative of conditions in the device under control. These signals may be digital signals or analog signals. In either case, the microprocessor periodically samples the signals at a certain sampling rate.
The thorough debugging and testing of software-controlled systems has been an ongoing challenge to system developers, and is an ongoing topic of intensive research. The debugging and testing of real-time systems in a real world environment often is impractical, or even dangerous, for several reasons:
(a) The environment to which the system must respond often is not conveniently available to the developer. PA1 (b) The critical emergency conditions that these systems must respond to often are sufficiently unusual not to be encountered even in a well-planned series of shakedown tests. PA1 (c) An undebugged system is likely to respond incorrectly to such an emergency condition, endangering both the system and the developer.
One successful and very popular approach to this problem has been to employ simulators. A digital simulator is a computer-embedded system that models the events of the system under control and the responses of the system itself and, on the basis of the modeling, generates the corresponding signals that would be presented to the microprocessor for sampling. Instead of connecting the controller to the peripherals, the controller is connected to the simulator, and the interaction of the microprocessor with simulated signals is monitored to see if the microprocessor responds as expected. Such a simulator may be used generally for the debugging, testing and evaluation of embedded systems.
One problem that arises in these simulations is that the simulator may not be able to model the external events fast enough to keep up with the controller's sampling rate. For example, a fuel injection system programmed to optimize fuel economy and engine power must react to a variety of external parameters, such as atmospheric pressure, temperature and humidity, and including parameters, such as engine temperature and cylinder pressure, which are themselves functions of the behavior of the fuel injection system. A simulator must perform many computations to model all these parameters at a high sampling rate, and this is not always possible in real time because of the limited compute power of the simulator.
There is thus a recognized need for, and it would be highly advantageous to have, a method of testing a real-time system, using a simulator, in which the simulator does not have to model external events as fast as the real-time system responds to them.